package service.impl;

import dao.PatientDao;
import entity.Patient;
import org.springframework.stereotype.Service;
import service.PatientService;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("patientService")
public class PatientServiceImpl implements PatientService {

    @Resource(name = "patientDao")
    private PatientDao patientDao;

    @Override
    public List<Patient> query(String name, String sex, String firstDate, String secondDate, int pageSize, int pageNumber) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("pName",name);
        map.put("pSex",sex);
        map.put("firstDate",firstDate);
        map.put("secondDate",secondDate);
        map.put("offset",(pageNumber-1)*pageSize);
        map.put("limit",pageSize);
        return patientDao.query(map);
    }



}
